#ifndef GRAPHICSOBJECT_H
#define GRAPHICSOBJECT_H

#include "abstractobject.h"

class Texture;
class Animation;
class CollisionShape;
class QUndoStack;

class GraphicsObject : public AbstractObject
{
    Q_OBJECT
    friend class Document;
public:
    typedef QList<QPointer<Animation> > AnimationSet;

    explicit GraphicsObject(QObject* parent = 0);

    void addAnimation(QPointer<Animation> anim);
    void removeAnimation(QPointer<Animation> anim);
    const AnimationSet& animations() const;

    QPointer<Animation> animationByID(const QString& id);

    QPointer<Texture> texture() const;

    bool hasAnimations() const;
    bool hasTexture() const;

    const QList<QPointer<CollisionShape> >& collisionShapes() const;
    QList<QPointer<CollisionShape> >& collisionShapes();
    QPointer<QUndoStack> csUndoStack() const;
private:
    QPointer<Texture> m_texture;
    QList<QPointer<CollisionShape> > m_collisionShapes;
    QPointer<QUndoStack> m_csUndoStack;
    // can have animations
    AnimationSet m_anims;
signals:
    void animationRemoved(QPointer<Animation> anim);
    void animationAdded(QPointer<Animation> anim);
    void textureChanged(QPointer<Texture> texture);
public slots:
    void setTexture(QPointer<Texture> texture);
};

#endif // GRAPHICSOBJECT_H
